package com.tianfei.crowd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 * SpringMVC 的配置类
 *
 * @author: Herz
 * @date: 2021/7/30 15:30
 */
@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        // 添加 view-controller
        // view-controller 是在 crowdfunding13-member-project-consumer 工程内部定义，不通过Zuul访问，所以不用加 Zuul 域名
        registry.addViewController("/new/crowd/to/agree/page").setViewName("project0-agree");
        registry.addViewController("/new/crowd/to/project/message/page").setViewName("project1-message");
        registry.addViewController("/new/crowd/to/project/return/page").setViewName("project2-return");
        registry.addViewController("/new/crowd/to/project/confirm/page").setViewName("project3-confirm");
        registry.addViewController("/new/crowd/to/project/success/page").setViewName("project4-success");
    }
}
